<template>
  <!--搜索框-->
  <div class="container" id="search">
    <form class="parent">
      <input type="text" v-model="word" >
      <input type="button" value="搜索" @click="query">
    </form>
  </div>
</template>

<script>
import axios from 'axios'

export default {
  name: 'test',
  el: '#search',
  data () {
    return {
      word: '',
      words: []
    }
  },
  methods: {
    query: function () {
      let url = 'http://localhost:8081/word/query/' + this.word
      axios.get(url).then(function (response) {
        console.log(response)
      }, function (err) {
        console.log(err)
      })
    }
  }
}
</script>

<style scoped>

</style>
